package com.nbjtjc.safe.bean;

import java.util.HashMap;

public class Result<T>{
    private int code=200;
    private String message="成功";
    private boolean success=true;
    private T data;

    public static Result  res( ){
        return new Result();
    }
    public static Result success(Object data){
        Result result=new Result();
        result.setData(data);
        return result;
    }
    public Result() {
    }
    public void setFalse(){
        success=false;
    }
    public void setFalse(String message){
        success=false;
        this.message=message;
    }
    public Result(String message, boolean success) {
        this.message = message;
        this.success = success;
    }

    public Result(T data) {
        this.data = data;
    }

    public Result(String message, boolean success, T data) {
        this.message = message;
        this.success = success;
        this.data = data;
    }

    public Result(int code, String message, boolean success, T data) {
        this.code = code;
        this.message = message;
        this.success = success;
        this.data = data;
    }

    public Result(int code, String message, boolean success) {
        this.code = code;
        this.message = message;
        this.success = success;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public boolean isSuccess() {
        return success;
    }

    public void setSuccess(boolean success) {
        this.success = success;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }
}
